	function getCountryNameById(i){
		var country;
		switch(i)//i为该国家绑定的编号
		{
			case 42:
			country = "中国";
			break;

			case 104: 
			country = "印度";
			break;

			case 238:
			country = "美国";
			break;

			case 102:
			country="印度尼西亚";
			break;

			case 33:
			country = "巴西";
			break;

			case 174:
			country = "巴基斯坦";
			break;

			case 165:
			country = "尼日利亚";
			break;

			case 22:
			country = "孟加拉国";
			break;

			case 191:
			country = "俄罗斯";
			break;

			case 146:
			country = "墨西哥";
			break;

			case 116:
			country = "日本";
			break;

			case 179:
			country = "菲律宾";
			break;

			case 73:
			country = "埃塞俄比亚";
			break;

			case 68: 
			country = "埃及";
			break;

			case 246:
			country = "越南";
			break;

			case 61:
			country = "德国";
			break;

			case 108:
			country = "伊朗";
			break;

			case 230:
			country = "土耳其";
			break;

			case 47:
			country = "刚果";
			break;

			case 223:
			country = "泰国";
			break;

			case 77:
			country = "法国";
			break;

			case 81:
			country = "英国";
			break;

			case 112:
			country = "意大利";
			break;

			case 252:
			country = "南非";
			break;

			case 233:
			country = "坦桑尼亚";
			break;
			
			case 151:
			country = "缅甸";
			break;

			case 125:
			country = "韩国";
			break;

			case 50:
			country = "哥伦比亚";
			break;

			case 120:
			country = "肯尼亚";
			break;

			case 71:
			country = "西班牙";
			break;

			case 235:
			country = "乌克兰";
			break;

			case 8:
			country = "阿根廷";
			break;

			case 234:
			country = "乌干达";
			break;

			case 66:
			country = "阿尔及利亚";
			break;

			case 196:
			country = "苏丹";
			break;

			case 182:
			country = "波兰";
			break;

			case 109:
			country = "伊朗";
			break;

			case 39:
			country = "加拿大";
			break;

			case 141:
			country = "摩洛哥";
			break;

			case 1:
			country = "阿富汗";
			break;

			case 194:
			country = "沙特阿拉伯";
			break;

			case 240:
			country = "乌兹别克斯坦";
			break;

			case 177:
			country = "秘鲁";
			break;

			case 243:
			country = "委内瑞拉";
			break;

			case 160:
			country = "马来西亚";
			break;

			case 170:
			country = "尼泊尔";
			break;

			case 155:
			country = "莫桑比克";
			break;

			case 2:
			country = "安哥拉";
			break;

			case 84:
			country = "加纳";
			break;

			default:
			country = "其他";
			break;
		}
		return country;
	}
//颜色分配器，每个语言对应一个rgb区间的颜色。
	//颜色深浅表示该国家说该语种的人数占该语种总人数的占比情况
	//为简化问题，默认一个国家只说一种语言
	function colorDispatcher(i){
		 var country;
		 var color;//最后返回的颜色
		 country =  getCountryNameById(i);

		countryLangInfo = {
			"中国":"汉语",
			"印度":"印度语",
			"美国":"英语",
			"印度尼西亚":"印度尼西亚语",
			"巴西":"葡萄牙语",
			"巴基斯坦":"乌尔都语",
			"尼日利亚":"英语",
			"孟加拉国":"孟加拉语",
			"俄罗斯":"俄语",
			"墨西哥":"西班牙语",
			"日本":"日语",
			"菲律宾":"菲律宾语",
			"埃塞俄比亚":"阿姆哈拉语",
			"埃及":"阿拉伯语",
			"越南":"越语",
			"德国":"德语",
			"伊朗":"波斯语",
			"土耳其":"土耳其语",
			"刚果":"法语",
			"泰国":"泰语",
			"法国":"法语",
			"英国":"英语",
			"意大利":"意大利语",
			"南非":"南非语",
			"坦桑尼亚":"斯瓦希里语",
			"缅甸":"缅甸语",
			"韩国":"韩语",
			"哥伦比亚":"西班牙语",
			"肯尼亚":"斯瓦希里语",
			"西班牙":"西班牙语",
			"乌克兰":"乌克兰语",
			"阿根廷":"西班牙语",
			"乌干达":"英语",
			"阿尔及利亚":"阿拉伯语",
			"苏丹":"阿拉伯语",
			"波兰":"波兰语",
			"伊拉克":"阿拉伯语",
			"加拿大":"英语",
			"摩洛哥":"阿拉伯语",
			"阿富汗":"普什图语",
			"沙特阿拉伯":"阿拉伯语",
			"乌兹别克斯坦":"乌兹别克语",
			"秘鲁":"西班牙语",
			"委内瑞拉":"西班牙语",
			"马来西亚":"马来语",
			"尼泊尔":"尼泊尔语",
			"莫桑比克":"葡萄牙语",
			"安哥拉":"葡萄牙语",
			"加纳":"英语"
		};
		countryPopuInfo = {
			"中国":13.79,
			"印度":13.24,
			"美国":3.23,
			"印度尼西亚":2.61,
			"巴西":2.08,
			"巴基斯坦":1.93,
			"尼日利亚":1.86,
			"孟加拉国":1.63,
			"俄罗斯":1.44,
			"墨西哥":1.28,
			"日本":1.27,
			"菲律宾":1.03,
			"埃塞俄比亚":1.02,
			"埃及":0.96,
			"越南":0.93,
			"德国":0.83,
			"伊朗":0.80,
			"土耳其":0.80,
			"刚果":0.79,
			"泰国":0.69,
			"法国":0.67,
			"英国":0.66,
			"意大利":0.61,
			"南非":0.56,
			"坦桑尼亚":0.56,
			"缅甸":0.53,
			"韩国":0.51,
			"哥伦比亚":0.49,
			"肯尼亚":0.48,
			"西班牙":0.46,
			"乌克兰":0.45,
			"阿根廷":0.44,
			"乌干达":0.41,
			"阿尔及利亚":0.41,
			"苏丹":0.40,
			"波兰":0.38,
			"伊拉克":0.37,
			"加拿大":0.36,
			"摩洛哥":0.35,
			"阿富汗":0.35,
			"沙特阿拉伯":0.32,
			"乌兹别克斯坦":0.32,
			"秘鲁":0.32,
			"委内瑞拉":0.32,
			"马来西亚":0.31,
			"尼泊尔":0.29,
			"莫桑比克":0.29,
			"安哥拉":0.29,
			"加纳":0.28
		};
		langInfo = {
			"汉语":{
				"min": 13.79,//说汉语的最小国家的人数
				"max":13.79,//说汉语的最大国家的人数
				"sum":13.79,//说汉语的总人数
				"rgbBegin": d3.rgb(255,0,0),//汉语被分配的颜色区间的起始颜色
				"rgbEnd": d3.rgb(255,0,0)//汉语被分配的颜色区间的终点颜色
			},
			"印度语":{
				"min": 13.24,
				"max":13.24,
				"rgbBegin": d3.rgb(204,0,255),
				"rgbEnd": d3.rgb(204,0,255)
			},
			"英语":{
				"min": 0.28,
				"max":3.23,
				"sum":6.8,
				"rgbBegin": d3.rgb(153,255,204),
				"rgbEnd": d3.rgb(102,204,0)
			},
			"西班牙语":{
				"min": 0.32,
				"max":1.28,
				"sum":3.3,
				"rgbBegin": d3.rgb(153,204,255),
				"rgbEnd": d3.rgb(153,51,255)
			},
			"阿拉伯语":{
				"min": 0.32,
				"max":1.02,
				"sum":2.81,
				"rgbBegin": d3.rgb(),
				"rgbEnd": d3.rgb()
			},
			"印度尼西亚语":{
				"min": 2.61,
				"max":2.61,
				"sum":2.61,
				"rgbBegin": d3.rgb(153,512,04),
				"rgbEnd": d3.rgb(153,51,51)
			},
			"乌尔都语":{
				"min": 1.93,
				"max":1.93,
				"sum":1.93,
				"rgbBegin": d3.rgb(153,102,0),
				"rgbEnd": d3.rgb(153,102,0)
			},
			"葡萄牙语":{
				"min":0.29,
				"max":2.08,
				"sum":2.65,
				"rgbBegin": d3.rgb(255,255,204),
				"rgbEnd": d3.rgb(255,255,0)
			},
			"孟加拉语":{
				"min":1.63,
				"max":1.63,
				"sum":1.63,
				"rgbBegin": d3.rgb(102,153,0),
				"rgbEnd": d3.rgb(102,153,0)
			},
			"法语":{
				"min":0.79,
				"max":0.79,
				"sum":0.79,
				"rgbBegin": d3.rgb(102,5,151),
				"rgbEnd": d3.rgb(102,5,151)
			},
			"俄语":{
				"min":1.44,
				"max":1.44,
				"sum":1.44,
				"rgbBegin": d3.rgb(51,153,0),
				"rgbEnd": d3.rgb(51,153,0)
			},
			"日语":{
				"min":1.27,
				"max":1.27,
				"sum":1.27,
				"rgbBegin": d3.rgb(51,0,204),
				"rgbEnd": d3.rgb(51,0,204)
			},
			"斯瓦希里语":{
				"min":0.48,
				"max":0.56,
				"sum":(0.48+0.56),
				"rgbBegin": d3.rgb(0,102,204),
				"rgbEnd": d3.rgb(0,0,204)
			},
			"菲律宾语":{
				"min":1.03,
				"max":1.03,
				"sum":1.03,
				"rgbBegin": d3.rgb(102,51,153),
				"rgbEnd": d3.rgb(102,51,153)
			},
			"阿姆哈拉语":{
				"min":1.02,
				"max":1.02,
				"sum":1.02,
				"rgbBegin": d3.rgb(102,0,102),
				"rgbEnd": d3.rgb(102,0,102)
			},
			"越语":{
				"min":0.93,
				"max":0.93,
				"sum":0.93,
				"rgbBegin": d3.rgb(204,102,0),
				"rgbEnd": d3.rgb(204,102,0)
			},
			"德语":{
				"min":0.83,
				"max":0.83,
				"sum":0.83,
				"rgbBegin": d3.rgb(255,102,0),
				"rgbEnd": d3.rgb(255,102,0)
			},
			"波斯语":{
				"min":0.80,
				"max":0.80,
				"sum":0.80,
				"rgbBegin": d3.rgb(255,102,0),
				"rgbEnd": d3.rgb(255,102,0)
			},
			"土耳其语":{
				"min":0.80,
				"max":0.80,
				"sum":0.80,
				"rgbBegin": d3.rgb(255,0,153),
				"rgbEnd": d3.rgb(255,0,153)
			},
			"泰语":{
				"min":0.69,
				"max":0.69,
				"sum":0.69,
				"rgbBegin": d3.rgb(255,0,153),
				"rgbEnd": d3.rgb(255,0,153)
			},
			"意大利语":{
				"min":0.61,
				"max":0.61,
				"sum":0.61,
				"rgbBegin": d3.rgb(102,0,204),
				"rgbEnd": d3.rgb(102,0,204)
			},
			"南非语":{
				"min":0.56,
				"max":0.56,
				"sum":0.56,
				"rgbBegin": d3.rgb(102,0,204),
				"rgbEnd": d3.rgb(102,0,204)
			},
			"缅甸语":{
				"min":0.53,
				"max":0.53,
				"sum":0.53,
				"rgbBegin": d3.rgb(51,153,0),
				"rgbEnd": d3.rgb(51,153,0)
			},
			"韩语":{
				"min":0.51,
				"max":0.51,
				"sum":0.51,
				"rgbBegin": d3.rgb(),
				"rgbEnd": d3.rgb()
			},
			"乌克兰语":{
				"min":0.45,
				"max":0.45,
				"sum":0.45,
				"rgbBegin": d3.rgb(51,153,0),
				"rgbEnd": d3.rgb(51,153,0)
			},
			"波兰语":{
				"min":0.38,
				"max":0.38,
				"sum":0.38,
				"rgbBegin": d3.rgb(0,0,102),
				"rgbEnd": d3.rgb(0,0,102)
			},
			"普什图语":{
				"min":0.35,
				"max":0.35,
				"sum":0.35,
				"rgbBegin": d3.rgb(0,0,102),
				"rgbEnd": d3.rgb(0,0,102)
			},
			"乌兹别克语":{
				"min":0.32,
				"max":0.32,
				"sum":0.32,
				"rgbBegin": d3.rgb(0,102,0),
				"rgbEnd": d3.rgb(0,102,0)
			},
			"马来语":{
				"min":0.31,
				"max":0.31,
				"sum":0.31,
				"rgbBegin": d3.rgb(51,102,102),
				"rgbEnd": d3.rgb(102,0,0)
			},
			"尼泊尔语":{
				"min":0.29,
				"max":0.29,
				"sum":0.29,
				"rgbBegin": d3.rgb(102,102,102),
				"rgbEnd": d3.rgb(102,102,102)
			}
		}
			if(country == "其他"){
				return "grey"
			}

			var lang = countryLangInfo[country];//该国语种
			var popu = countryPopuInfo[country];//该国人口数
			//testcode -- 0
			console.log(country);
			// console.log("lang: "+lang);
			// console.log("popu: "+popu);
			 console.log("第一次打印i: "+i);
			// //testcode -- 1
			var domainMin = langInfo[lang].min;
			var domainMax = langInfo[lang].max;

			var rgbBegin = langInfo[lang]["rgbBegin"];
			var rgbEnd = langInfo[lang]["rgbEnd"];

			var color = d3.interpolate(rgbBegin,rgbEnd);//颜色插值函数 
			var linear = d3.scale.linear()  
        				.domain([domainMin,,domainMax])  
        				.range([0, 1]);  


			//testcode -- 1
			console.log("linear: "+linear(popu));
			console.log("domainMin: "+domainMin);
			console.log("domainMin: "+domainMax);
        	console.log("country: "+country);
			console.log("lang: "+lang);
			console.log("popu: "+popu);
			console.log("第二次打印i: "+i);
			//testcode -- 1

        	return color(popu)
	}